{{extend "layout.html"}}
<!--  CSS specific to this page -->
<style>
    td.inset {
        width : 32px /*same as icon*/
        }
</style>
{{
problemicon = URL(r=request, c='static', f="rubik32.png")
checkicon = URL(r=request, c='static', f="small_green_check.png")
crossicon = URL(r=request, c='static', f="small_red_cross.png")
FC = form.custom
FCW = FC.widget
}}
<div id=pagehelpcontent class=hidden>
<h3><strong>{{=T("Page Help")}}</strong></h3>
<p>{{=T("Use this page to invite others to this problem and view the status of your invitations.")}}</p> 
<p>{{=T("To add a new invitation, enter the person's email address and click Submit.")}}</p>
<p><em>{{=T("Note: If you've just created this problem, invitations will not be visible to invitees until you 'deliver' the problem by checking the 'issue invitations' box on this page. This gives you an opportunity to proofread and edit the list of invitees. Once the problem has been delivered the 'issue invitations' box is no longer shown and new invitations are visible immediately. At that time, your special status as creator of the problem ends and neither you nor anyone else can edit existing invitations. You and all other participants will still be able to add new invitations to the list.")}}</em></p>
<p>{{=T("Status of invitations is indicated by icons")}}</p>
    <ul>
    <li><img src="{{=checkicon}}">&nbsp;{{=T("User has accepted.")}}</li>
    <li><img src="{{=crossicon}}">&nbsp;{{=T("User has declined.")}}</li>
    <li>{{=T("No icon means the user is undecided or unaware of the invitation.")}}</li>
    </ul>

</div>
<h1 id="pagetitle" class="clickable">{{=T("Invitations")}}</h1>
{{=TABLE(TR(TD(IMG(_src=problemicon)),TD(XML(FCW["Title"]))))}}
{{=FC.begin}}
<table>
    <tr>
    <td class="inset">&nbsp;</td>
    <td>New</td>
    <td>{{=FCW["new_invitation"]}}</td>
    </tr>    
{{
    for r in invrows:
        iid = "I%d"%r.id
        status = r.accepted
        widget = FCW[iid]
        if status == True:
            icontd = TD(IMG(_src=checkicon))
        elif status == False:
            icontd = TD(IMG(_src=crossicon))
        elif status == None:
            icontd = TD()
            pass
        =TR(TD(_class="inset"),icontd,TD(widget))
        pass

}}
</table>
{{
if editable:
    widget = FCW["deliver"]
    instructions = T(
        "Check this box to when you are ready to "\
        "issue invitations."
        )
    =TABLE(TR(_height="3em"),TR( TD(widget,_class="inset"), TD(instructions)))
    pass
=FC.submit
=FC.end
}}
{{#=form}}
